package com.youlai.boot.system.converter;

import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeFormatterRegistrar implements FormatterRegistrar {
    @Override
    public void registerFormatters(FormatterRegistry registry) {
        DateTimeFormatter  dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:00");
        registry.addFormatterForFieldType(LocalDateTime.class,new DateTimeFormatterConverter(dateTimeFormatter));
    }
}
